package com.bjsxt.service;

import com.bjsxt.domain.Account;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

/**
 * @Description:  ${description}
 * @ClassName:      AccountService
 * @Author:  chenyu
 * @Date:    2025/3/13 14:57
 */
 
public interface AccountService extends IService<Account>{

    //给用户转入余额
    /**
     * @param adminId 管理员id
     * @param userId 用户id
     * @param coinId 币种id
     * @param num
     * @param fee
     * @return boolean
    */
    boolean transferAccountAmount(Long adminId, Long userId, Long coinId, Long orderNum, BigDecimal num, BigDecimal fee,
                                  String remark, String businessType, Byte direction);

    //给用户扣减余额
    boolean decreaseAccountAmount(Long adminId, Long userId, Long coinId, Long orderNum, BigDecimal num, BigDecimal fee,
                                  String remark, String businessType, Byte direction);

    /**
     * 查询某个用户的货币资产
     * @param userId
     *  用户的id
     * @param coinName
     * 货币的名称
     * @return
     */
    Account findByUserAndCoin(Long userId, String coinName);

    /**
     * 暂时锁定用户的资产
     * @param userId
     *  用户的id
     * @param coinId
     * 币种的id
     * @param mum
     * 锁定的金额
     * @param type
     *      资金流水的类型
     * @param orderId
     *      订单的Id
     * @param fee
     *  本次操作的手续费
     */
    void lockUserAmount(Long userId, Long coinId, BigDecimal mum, String type, Long orderId, BigDecimal fee);
}
